package com.tanhua.dubbo.api;

import com.tanhua.model.domain.User;
import com.tanhua.model.vo.DistributionVo;

import java.time.LocalDate;
import java.util.HashMap;
import java.util.List;

public interface UserApi {

    //根据手机号码查询用户
    User findByMobile(String mobile);

    //保存用户，返回用户id
    Long save(User user);

    void updatePhone(User user);

    User findById(Long userId);

    List<User> findAll();

    void update(User user);

    User findByHuanxin(String huanxinId);

    Integer userCount();

    Integer newUserCount(Integer day);

    Integer finActivityForDays(Integer day);

    Long getUseTimePassWeek();

    HashMap newUserCount(LocalDate start, LocalDate end);

    HashMap activeUserCount(LocalDate start, LocalDate end);

    HashMap retainedUserCount(LocalDate start, LocalDate end);


    List<DistributionVo> getAgeRange(LocalDate start, LocalDate end);


    List<DistributionVo> getGenderRange(LocalDate start, LocalDate end);


    List<DistributionVo> getLocalRange(LocalDate start, LocalDate end);


    List<DistributionVo> getLocalTotal(LocalDate start, LocalDate end);


    List<DistributionVo> getIndustry(LocalDate start, LocalDate end);
}
